<script setup>
import { onMounted, ref } from 'vue'
import InUse from '@renderer/views/InUse.vue'
import RegistApp from '@renderer/views/RegistApp.vue'
const showUI = ref(false)
onMounted(() => {
  if (document.documentElement.clientWidth / document.documentElement.clientHeight >= 1.7) {
    document.documentElement.style.fontSize =
      (document.documentElement.clientWidth * 9 + document.documentElement.clientHeight * 16) /
        2500 +
      'px'
  } else {
    document.documentElement.style.fontSize =
      (document.documentElement.clientWidth * 7 + document.documentElement.clientHeight * 12) /
        1800 +
      'px'
  }
  window.main2render.send('renderer-ready')
  window.main2render.receive('show-normal', (data) => {
    showUI.value = data.showui
  })
})
</script>

<template>
  <div class="main_container">
    <InUse v-if="showUI" id="appcomp"></InUse>
    <RegistApp v-if="!showUI" id="regcomp"></RegistApp>
  </div>
</template>

<style lang="scss" scoped>
.main_container {
  width: 100vw;
  height: 100vh;
  #appcomp {
    z-index: 3;
  }
  #regcomp {
    z-index: 99;
  }
}
</style>
